package com.xinchuang.service.impl;

import com.alibaba.fastjson.JSON;
import com.xinchuang.comment.R;
import com.xinchuang.constant.FileTypeConstant;
import com.xinchuang.entity.common.FileTable;
import com.xinchuang.service.PrecisionService;
import com.xinchuang.service.common.FileTableService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.List;

@Service
public class PrecisionServiceImpl implements PrecisionService {

    private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    @Resource
    private FileTableService fileTableService;

    @Override
    public String precisionList() {
        List<FileTable> fileTables = fileTableService.lambdaQuery()
                .eq(FileTable::getType, FileTypeConstant.PRECISION)
                .list();
        return JSON.toJSONString(R.data(fileTables));
    }
}
